package com.ztp.lib.utils;

import java.io.File;

public class Utils {

	public static boolean [] validateUserData(
			String username
			, String pass
			, String homedir
			, int idleTime
			, int upRate
			,int downRate
			,int maxLoginNumber
			,int maxLoginPerIp){
		
		return null;
		
	}
	
	public static String getFileExt(File f){
		return null;
	}
	
	public static String convertFileSize(long bytes){
		if(bytes < 1000){
			return bytes + " B";
		}
		else if(bytes < 1000000L){
			return (Math.round(bytes / 1000)) + " KB";
		}
		else if(bytes < 1000000000L){
			return (Math.round(bytes / 1000000)) + " MB";
		}
		else if(bytes < 1000000000000L){
			return (Math.round(bytes / 1000000000)) + " GB";
		}
		return "OOR";
	}
}
